<template>
	<view class="history-pages">
		<view class="search-block">
			<input placeholder="请输入关键字" v-model="keyword" class="search" />
			<view class="small-btn normal">搜索</view>
		</view>
		<view class="info-item" v-for="item in list" :key="item.id">
			<view class="name-item">
				<view class="name">{{item.name}}</view>
				<view class="price">￥{{item.price}}</view>
			</view>
			<view class="history-item">
				<view class="history-info">
					<view class="type red" v-if="item.type==1">全电普票</view>
					<view class="type yellow" v-if="item.type==2">全电专票</view>
					<view class="time">{{item.time}}</view>
				</view>
				<view class="status" v-if="item.status==1" style="color: #fb4744;">已申请</view>
				<view class="status" v-if="item.status==2" style="color: #18aa00;">已开具</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				keyword: '',
				list: [{
						id: 1,
						name: '王建国',
						price: '1162.56',
						type: 1,
						time: '2025-03-07',
						status: 1
					},
					{
						id: 2,
						name: '王建国',
						price: '400.0',
						type: 2,
						time: '2025-03-07',
						status: 2
					},
					{
						id: 3,
						name: '王建国',
						price: '500.0',
						type: 1,
						time: '2025-03-07',
						status: 2
					}
				]
			}
		},
		methods: {

		}
	}
</script>

<style lang="scss" scoped>
	.history-pages {
		padding: 30rpx;

		.search-block {
			background-color: #fff;
			height: 80rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			border-radius: 60rpx;
			padding: 0 20rpx;

			.small-btn {
				width: 140rpx;
			}
		}

		.info-item {
			background-color: #fff;
			padding: 40rpx 30rpx;
			border-radius: 30rpx;
			margin-top: 30rpx;

			.name-item {
				display: flex;
				align-items: center;
				justify-content: space-between;
				margin-bottom: 30rpx;

				.name {
					font-size: 30rpx;
				}

				.price {
					font-weight: bold;
					font-size: 30rpx;
				}
			}

			.history-item {
				display: flex;
				align-items: center;
				justify-content: space-between;

				.history-info {
					display: flex;
					align-items: center;

					.red {
						background: $error-background;
						color: $theme-color;
					}

					.yellow {
						background-color: #fff5e6;
						color: #ffa100;
					}

					.type {
						font-size: 24rpx;
						width: 120rpx;
						height: 44rpx;
						display: flex;
						align-items: center;
						justify-content: center;
						border-radius: 10rpx;
						margin-right: 20rpx;
					}

					.time {
						font-size: 28rpx;
						color: #767676;
					}
				}

				.status {
					font-size: 28rpx;
				}
			}
		}
	}
</style>